THE BEST FIFTY FIVE PROJECT WITH THE ARDUiNO by Elif AVCU

THE BEST FIFTY FIVE PROJECT WITH THE ARDUiNO by Elif AVCU

Author:Elif AVCU [AVCU, Elif]
Language: eng
Format: azw3
Published: 2018-12-19T16:00:00+00:00


/* s=30 means ANALOG INPUT *************************** */

case 30:

/* the second received value indicates the pin

from abs('a')=97, pin 0, to abs('p')=112, pin 15 */

if (val>96 && val<113) {

pin=val-97; /* calculate pin */

agv=analogRead(pin); /* perform Analog Input */

Serial.println(agv); /* send value via serial */

}

s=-1; /* we are done with AI so next state is -1 */

break; /* s=30 taken care of */

/* s=40 or 41 means ANALOG OUTPUT ******************** */

case 40:

/* the second received value indicates the pin

from abs('c')=99, pin 2, to abs('¦')=166, pin 69 */

if (val>98 && val<167) {

pin=val-97; /* calculate pin */

s=41; /* next we will need to get value from serial */

}

else {

s=-1; /* if value is not a pin then return to -1 */

}

break; /* s=40 taken care of */



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.